package leetcode.weekly.week299;

//Solution1Test
public class Solution1 {
	// Solution1Test
	public boolean checkXMatrix(int[][] grid) {
		int m = grid.length, n = grid[0].length;
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < n; j++) {
				int cur = grid[i][j];
				if (i == j || i == n - j - 1) {
					if (cur == 0) {
						return false;
					}
				} else {
					if (cur != 0) {
						return false;
					}
				}

			}
		}
		return true;
	}

}
